{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "# 首先 import 必要的模块\n",
    "import pandas as pd \n",
    "import numpy as np\n",
    "\n",
    "#LinearSVC不支持概率\n",
    "#所以用正确率accuracy_score作为模型选择的度量\n",
    "from sklearn.metrics import accuracy_score\n",
    "\n",
    "from sklearn.metrics import classification_report\n",
    "from sklearn.metrics import confusion_matrix\n",
    "\n",
    "from matplotlib import pyplot as plt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>pregnants</th>\n",
       "      <th>Plasma_glucose_concentration</th>\n",
       "      <th>blood_pressure</th>\n",
       "      <th>Triceps_skin_fold_thickness</th>\n",
       "      <th>serum_insulin</th>\n",
       "      <th>BMI</th>\n",
       "      <th>Diabetes_pedigree_function</th>\n",
       "      <th>Age</th>\n",
       "      <th>Target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.639947</td>\n",
       "      <td>0.866045</td>\n",
       "      <td>-0.031990</td>\n",
       "      <td>0.670643</td>\n",
       "      <td>-0.181541</td>\n",
       "      <td>0.166619</td>\n",
       "      <td>0.468492</td>\n",
       "      <td>1.425995</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.844885</td>\n",
       "      <td>-1.205066</td>\n",
       "      <td>-0.528319</td>\n",
       "      <td>-0.012301</td>\n",
       "      <td>-0.181541</td>\n",
       "      <td>-0.852200</td>\n",
       "      <td>-0.365061</td>\n",
       "      <td>-0.190672</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.233880</td>\n",
       "      <td>2.016662</td>\n",
       "      <td>-0.693761</td>\n",
       "      <td>-0.012301</td>\n",
       "      <td>-0.181541</td>\n",
       "      <td>-1.332500</td>\n",
       "      <td>0.604397</td>\n",
       "      <td>-0.105584</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.844885</td>\n",
       "      <td>-1.073567</td>\n",
       "      <td>-0.528319</td>\n",
       "      <td>-0.695245</td>\n",
       "      <td>-0.540642</td>\n",
       "      <td>-0.633881</td>\n",
       "      <td>-0.920763</td>\n",
       "      <td>-1.041549</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-1.141852</td>\n",
       "      <td>0.504422</td>\n",
       "      <td>-2.679076</td>\n",
       "      <td>0.670643</td>\n",
       "      <td>0.316566</td>\n",
       "      <td>1.549303</td>\n",
       "      <td>5.484909</td>\n",
       "      <td>-0.020496</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   pregnants  Plasma_glucose_concentration  blood_pressure  \\\n",
       "0   0.639947                      0.866045       -0.031990   \n",
       "1  -0.844885                     -1.205066       -0.528319   \n",
       "2   1.233880                      2.016662       -0.693761   \n",
       "3  -0.844885                     -1.073567       -0.528319   \n",
       "4  -1.141852                      0.504422       -2.679076   \n",
       "\n",
       "   Triceps_skin_fold_thickness  serum_insulin       BMI  \\\n",
       "0                     0.670643      -0.181541  0.166619   \n",
       "1                    -0.012301      -0.181541 -0.852200   \n",
       "2                    -0.012301      -0.181541 -1.332500   \n",
       "3                    -0.695245      -0.540642 -0.633881   \n",
       "4                     0.670643       0.316566  1.549303   \n",
       "\n",
       "   Diabetes_pedigree_function       Age  Target  \n",
       "0                    0.468492  1.425995       1  \n",
       "1                   -0.365061 -0.190672       0  \n",
       "2                    0.604397 -0.105584       1  \n",
       "3                   -0.920763 -1.041549       0  \n",
       "4                    5.484909 -0.020496       1  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "train = pd.read_csv(\"FE_pima-indians-diabetes-1.csv\")\n",
    "\n",
    "train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 768 entries, 0 to 767\n",
      "Data columns (total 9 columns):\n",
      "pregnants                       768 non-null float64\n",
      "Plasma_glucose_concentration    768 non-null float64\n",
      "blood_pressure                  768 non-null float64\n",
      "Triceps_skin_fold_thickness     768 non-null float64\n",
      "serum_insulin                   768 non-null float64\n",
      "BMI                             768 non-null float64\n",
      "Diabetes_pedigree_function      768 non-null float64\n",
      "Age                             768 non-null float64\n",
      "Target                          768 non-null int64\n",
      "dtypes: float64(8), int64(1)\n",
      "memory usage: 54.1 KB\n"
     ]
    }
   ],
   "source": [
    "train.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_train = train['Target']   #形式为Class_x\n",
    "X_train = train.drop([\"Target\"], axis=1)\n",
    "\n",
    "#保存特征名字以备后用（可视化）\n",
    "feat_names = X_train.columns "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/var/sw/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/_split.py:2026: FutureWarning: From version 0.21, test_size will always complement train_size unless both are specified.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "X_train_part, X_val, y_train_part, y_val = train_test_split(\n",
    "    X_train, y_train, train_size = 0.8,random_state = 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(614, 8)\n"
     ]
    }
   ],
   "source": [
    "print(X_train_part.shape)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 模型训练"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 默认参数的 SVC"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LinearSVC(C=10.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "     intercept_scaling=1, loss='squared_hinge', max_iter=1000,\n",
       "     multi_class='ovr', penalty='l2', random_state=None, tol=0.0001,\n",
       "     verbose=0)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.svm import LinearSVC\n",
    "\n",
    "#LinearSVC不能得到每类的概率（只有predict函数，没有predict_proba函数）\n",
    "#1. 生成学习器实例\n",
    "SVC1 = LinearSVC(C=10.0, dual=False)\n",
    "\n",
    "#2. 模型训练\n",
    "SVC1.fit(X_train_part, y_train_part)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy is:  0.811688311688\n",
      "Classification report:\n",
      "             precision    recall  f1-score   support\n",
      "\n",
      "          0       0.84      0.91      0.87       107\n",
      "          1       0.74      0.60      0.66        47\n",
      "\n",
      "avg / total       0.81      0.81      0.81       154\n",
      "\n",
      "Confusion matrix:\n",
      "[[97 10]\n",
      " [19 28]]\n"
     ]
    }
   ],
   "source": [
    "#3. 在校验集上测试，估计模型性能\n",
    "y_predict = SVC1.predict(X_val)\n",
    "\n",
    "print(\"accuracy is: \",accuracy_score(y_val, y_predict))\n",
    "\n",
    "print(\"Classification report:\")\n",
    "print(classification_report(y_val, y_predict))\n",
    "\n",
    "print(\"Confusion matrix:\")\n",
    "print(confusion_matrix(y_val, y_predict))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy is:  0.811688311688\n"
     ]
    }
   ],
   "source": [
    "#1. 生成学习器实例\n",
    "SVC2 = LinearSVC(C=1, dual=False)\n",
    "\n",
    "#2. 模型训练\n",
    "SVC2.fit(X_train_part, y_train_part)\n",
    "\n",
    "#3. 在校验集上测试，估计模型性能\n",
    "y_predict = SVC1.predict(X_val)\n",
    "\n",
    "print(\"accuracy is: \",accuracy_score(y_val, y_predict))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- dual=True时,合页损失及合页平方损失不支持l1正则"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 线性SVM正则参数调优"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "线性SVM LinearSVC的需要调整正则超参数包括C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和正则函数penalty（L2/L1） \n",
    "\n",
    "采用交叉验证，网格搜索步骤与Logistic回归正则参数处理类似，在此略。\n",
    "\n",
    "这里我们用校验集（X_val、y_val）来估计模型性能"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy  score: 0.772135416667\n",
      "accuracy  params: {'C': 0.01, 'penalty': 'l2'}\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import GridSearchCV\n",
    "\n",
    "# 不支持 (l1正则+loss函数为合页平方和时)\n",
    "SVC3 = LinearSVC(dual=False)\n",
    "penaltys = ['l1', 'l2']\n",
    "Cs = [0.01, 0.1, 1, 10, 100]\n",
    "\n",
    "tuned_parammeters = dict(penalty=penaltys, C = Cs)\n",
    "#tuned_parammeters = dict(C = Cs)\n",
    "\n",
    "grid = GridSearchCV(SVC3, tuned_parammeters, cv=5, scoring='accuracy', return_train_score = True)\n",
    "grid.fit(X_train, y_train)\n",
    "\n",
    "print('accuracy', ' score:', abs(grid.best_score_))\n",
    "print('accuracy', ' params:', grid.best_params_)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "- 为什么正确率不如直接训练结果? 而且调整参数正确率不变?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEKCAYAAAAvlUMdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzt3Xl8VfWd//HXx7AvyhZkCUuAALII\naAparYq71oooYmi1auvQWrFV21/HtvOrynQ6Ooq4VKUWF+wiWiqWOioBAaEOKJECApYQECUsguwI\nIdtn/rgnziXeJDfhntws7+fjkQfnfM/3fM/nnFzuJ9+zfI+5OyIiIol2QrIDEBGRhkkJRkREQqEE\nIyIioVCCERGRUCjBiIhIKJRgREQkFEowIiISCiUYEREJhRKMiIiEokmyA0imTp06ee/evZMdhohI\nvfL+++9/5u6pVdVr1Ammd+/e5OTkJDsMEZF6xcw+jqeeTpGJiEgolGBERCQUSjAiIhIKJRgREQmF\nEoyIiIRCCUZEREKhBCMiIqFo1M/B1Nin62Dt7ONvx+z42yABbSiOhDdRd46HSAXSvgLp54S6CSWY\nmvhsPSx+8Dgb8YSEIiJSI2fdoQRTJw0eG/lpCDwBiS4RbSQi4SoOkfhZSuibC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
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_means = grid.cv_results_['mean_test_score']\n",
    "test_stds = grid.cv_results_['std_test_score']\n",
    "train_means = grid.cv_results_['mean_train_score']\n",
    "train_stds = grid.cv_results_['std_train_score']\n",
    "\n",
    "n_Cs = len(Cs)\n",
    "number_penaltys = len(penaltys)\n",
    "test_scores  = np.array(test_means).reshape(n_Cs, number_penaltys)\n",
    "train_scores   = np.array(train_means).reshape(n_Cs, number_penaltys)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs, number_penaltys)\n",
    "train_stds  = np.array(train_stds).reshape(n_Cs, number_penaltys)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #plt.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i], label = penaltys[i]+' Test')\n",
    "    #plt.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i], label = penaltys[i]+' Train')\n",
    "    plt.errorbar(x_axis, test_scores[:,i], label = penaltys[i]+' Test')\n",
    "    plt.errorbar(x_axis, train_scores[:,i], label = penaltys[i]+' Train')\n",
    "\n",
    "plt.legend()\n",
    "plt.xlabel('log(C)')\n",
    "plt.ylabel('accuracy')\n",
    "plt.savefig('logisticGridSearchCV_accuracy_C.png')\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### RBF核SVM正则参数调优\n",
    "\n",
    "RBF核是SVM最常用的核函数。\n",
    "RBF核SVM 的需要调整正则超参数包括C（正则系数，一般在log域（取log后的值）均匀设置候选参数）和核函数的宽度gamma\n",
    "C越小，决策边界越平滑； \n",
    "gamma越小，决策边界越平滑。\n",
    "\n",
    "采用交叉验证，网格搜索步骤与Logistic回归正则参数处理类似，在此略。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "accuracy  score: 0.766927083333\n",
      "accuracy  params: {'C': 1, 'gamma': 0.01}\n"
     ]
    }
   ],
   "source": [
    "from sklearn.svm import SVC\n",
    "\n",
    "\n",
    "# 在训练集是那个利用SVC训练\n",
    "SVC_RBF =  SVC(kernel='rbf')\n",
    "gammas = [0.01, 0.1,1, 10]\n",
    "Cs = [0.01, 0.1, 1, 10]\n",
    "\n",
    "tuned_parammeters = dict(gamma=gammas, C = Cs)\n",
    "#tuned_parammeters = dict(C = Cs)\n",
    "\n",
    "grid2 = GridSearchCV(SVC_RBF, tuned_parammeters, cv=5, scoring='accuracy', return_train_score = True)\n",
    "grid2.fit(X_train, y_train)\n",
    "\n",
    "print('accuracy', ' score:', abs(grid2.best_score_))\n",
    "print('accuracy', ' params:', grid2.best_params_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYsAAAEKCAYAAADjDHn2AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAIABJREFUeJzs3Xd4FFUXx/HvTe8JSYAQQgeRJkhH\nUURRxALSVJAiBFCx+6oUERAsKFgQEYTQqxI6ClhAxUIXCyDShBRKem+7e98/JoSEBAmQzSab83me\nPNndubt7Ekh+uTNz7iitNUIIIcR/cbB1AUIIIco+CQshhBBXJGEhhBDiiiQshBBCXJGEhRBCiCuS\nsBBCCHFFEhZCCCGuSMJCCCHEFUlYCCGEuCInWxdQUgIDA3Xt2rVtXYYQQpQr+/bti9VaV77SOLsJ\ni9q1a7N3715blyGEEOWKUupUccbJbighhBBXJGEhhBDiiiQshBBCXJHdHLMoSk5ODpGRkWRmZtq6\nFLvi5uZGSEgIzs7Oti5FCFFK7DosIiMj8fb2pnbt2iilbF2OXdBaExcXR2R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71r2t3vKnFcQPaL4h1gD3BfZRxkZ4I8lR7P\ndGIc9cbSDcsk9XEp8CDwfHpeksYPA7ek4TOBbWm5bAMub3e/a33GwLVkP64A5gF3pu/R48AJ7e7z\nDGL5UfpePAU8DJzU7j5PEcftwCvAWPqeXA6sB9an6QJuTHFuo8bZkdN5+ApuMzPLNWt3Q5mZWf2c\nLMzMLJeThZmZ5XKyMDOzXE4WZmaWy8nC7AhIenOGr78rXa2NpPmSbpL0Qrrb7hZJp0saSMM9fdGs\ndRcnC7MWkXQy0BcRu9OoW8iuel4dESeT3f10KLIb3j0IXNyWjppV4WRhNg3pKtkbJG1PdUIuTuML\nkn6WthTukbRZ0oXpZV8iXckt6UTgdOA7EVGE7JYfEXFvarshtTfrCN7MNZueLwAfA04FhoAnJG0h\nu2XH8cApZHea3QHcml6zhuwqXICTga0RMTHF/LcDn2hKz82mwVsWZtNzFtmdSiciYg/wJ7KV+1nA\nnRFRjIhXyW4fUbIC2FfPzFMSOVi6p5dZuzlZmE3PVIV+ahUAepvsnkqQ3YvoVEm1voNzgQPT6JtZ\nwzlZmE3PFuBiSX2SlpGVvHwc+AtZIZ2CpOXA2WWv2QF8ACCymhUjwPdLFeYkrZa0Lg0vBfZFxFir\nAjKrxcnCbHruBp4mu1PpQ8A3026n35DdEXQ7cBPwGFkVOYB7mZw8riArnrRL0jayWgql+gNrgc3N\nDcGsfr7rrFmDSZofEW+mrYPHyaoUvirpKLJjGGtqHNguzeO3wLejR+qrW/fz2VBmjXePpMXAAPCD\ntMVBRLwt6btkdZH/NdWLU5GeDU4U1km8ZWFmZrl8zMLMzHI5WZiZWS4nCzMzy+VkYWZmuZwszMws\nl5OFmZnl+j/FtBhH4sIYDAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f30293fcd30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "test_means = grid2.cv_results_['mean_test_score']\n",
    "test_stds = grid2.cv_results_['std_test_score']\n",
    "train_means = grid2.cv_results_['mean_train_score']\n",
    "train_stds = grid2.cv_results_['std_train_score']\n",
    "\n",
    "n_Cs = len(Cs)\n",
    "n_gammas = len(gammas)\n",
    "test_scores  = np.array(test_means).reshape(n_Cs, n_gammas)\n",
    "train_scores   = np.array(train_means).reshape(n_Cs, n_gammas)\n",
    "test_stds = np.array(test_stds).reshape(n_Cs, n_gammas)\n",
    "train_stds  = np.array(train_stds).reshape(n_Cs, n_gammas)\n",
    "\n",
    "x_axis = np.log10(Cs)\n",
    "number_gammass = len(gammas)\n",
    "for i, value in enumerate(penaltys):\n",
    "    #plt.errorbar(x_axis, test_scores[:,i], yerr=test_stds[:,i], label = penaltys[i]+' Test')\n",
    "    #plt.errorbar(x_axis, train_scores[:,i], yerr=train_stds[:,i], label = penaltys[i]+' Train')\n",
    "    plt.errorbar(x_axis, test_scores[:,i], label = str(gammas[i])+' Test')\n",
    "    plt.errorbar(x_axis, train_scores[:,i], label = str(gammas[i])+' Train')\n",
    "\n",
    "plt.legend()\n",
    "plt.xlabel('log(C)')\n",
    "plt.ylabel('accuracy')\n",
    "plt.savefig('logisticGridSearchCV_accuracy_C.png')\n",
    "\n",
    "plt.show()"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
